define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'mall.applygoods/index',
        add_url: 'mall.applygoods/add',
        edit_url: 'mall.applygoods/edit',
        delete_url: 'mall.applygoods/delete',
        export_url: 'mall.applygoods/export',
        modify_url: 'mall.applygoods/modify',
    };

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                toolbar: ['refresh',
                    [],
                    'export'],
                cols: [[
                    {type: 'checkbox'},
                    {field: 'id', title: 'id'},
                    {field: 'goods_name', title: '商品名称'},
                    {field: 'realname', title: '姓名'},
                    {field: 'mobile', title: '电话'},
                    {field: 'create_time', title: '申请时间',search: 'range'},
                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
});